import 'package:flutter_xj_video/entity/film_type_entity.dart';

filmTypeEntityFromJson(FilmTypeEntity data, Map<String, dynamic> json) {
	if (json['ty'] != null) {
		data.ty = (json['ty'] as List).map((v) => FilmTypeTy().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> filmTypeEntityToJson(FilmTypeEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['ty'] =  entity.ty?.map((v) => v.toJson())?.toList();
	return data;
}

filmTypeTyFromJson(FilmTypeTy data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['tname'] != null) {
		data.tname = json['tname'].toString();
	}
	return data;
}

Map<String, dynamic> filmTypeTyToJson(FilmTypeTy entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['tname'] = entity.tname;
	return data;
}